﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WPFCouse
{
    /// <summary>
    /// CalendarWindow.xaml 的交互逻辑
    /// </summary>
    public partial class CalendarWindow : Window
    {
        public CalendarWindow()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 选择的日期范围发生改变时
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Calendar_SelectedDatesChanged(object sender, SelectionChangedEventArgs e)
        {
            txtStart.Text = selCaledar.SelectedDates.First().ToString("yyyy-MM-dd 00:00:00");
            txtEnd.Text = selCaledar.SelectedDates.Last().ToString("yyyy-MM-dd 23:59:59");
        }

        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            //当前的选定日期  selCaledar.SelectedDate
            DateTime selDate = selCaledar.SelectedDate.Value;
        }
    }
}
